package org.utils.rmi;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class SSLUnicastRemoteObject extends UnicastRemoteObject
{
	private static final long serialVersionUID = -6764263997197579911L;

	public SSLUnicastRemoteObject() throws SSLSocketFactoryException, RemoteException
	{
		this(0);
	}

	public SSLUnicastRemoteObject(int port) throws SSLSocketFactoryException, RemoteException
	{
		super(
			port,
			SSLClientSocketFactory.getDefaultFactory(),	
			SSLServerSocketFactory.getDefaultFactory()
		);
	}

	public SSLUnicastRemoteObject(int port, String socketClassName) throws SSLSocketFactoryException, RemoteException
	{
		super(
			port,
			SSLClientSocketFactory.getFactory(socketClassName),	
			SSLServerSocketFactory.getFactory(socketClassName)
		);
	}

	public SSLUnicastRemoteObject(int port, Class socketClass) throws SSLSocketFactoryException, RemoteException
	{
		super(
			port,
			SSLClientSocketFactory.getFactory(socketClass),	
			SSLServerSocketFactory.getFactory(socketClass)
		);
	}
}
